package cn.edu.njnu.controller;

import cn.edu.njnu.dto.AdviceDto;
import cn.edu.njnu.pojo.Result;
import cn.edu.njnu.service.AdviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Map;

@RestController
@RequestMapping("/e-resource/api")
public class AdviceController extends BaseController{
    @Autowired
    private AdviceService adviceService;
    @PostMapping("/v1.0/public/adviceFeedback")
    public Result addAdvice(@RequestBody Map<String, Object> fieldMap){
        return adviceService.addAdvice(fieldMap);
    }
    @GetMapping("/v1.0/public/advice")
    public Result getAdvice(@Valid AdviceDto adviceDto){
        return adviceService.getAdvice(adviceDto);
    }
}
